#ifndef _SKYDOME_H_
#define _SKYDOME_H_

#ifdef WIN32
#include <windows.h>
#endif

#include <stdlib.h>
#include <stdio.h>

#include <math.h>

#include <iostream>
#include <fstream>

#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include "Texture.h"
#include "FPGrabber.h"

#ifndef PI
#define PI 3.1415926535897f
#endif
#ifndef DTOR
#define DTOR (PI / 180.0f)
#endif
#ifndef DWORD
#define DWORD long
#endif

// struct section
#ifndef _MY_VERTEX_
#define _MY_VERTEX_
typedef struct {
	float x,y,z;
	float u,v;
	DWORD color;
} VERTEX;
#endif

class skydome {
	
private:
	void generateSphereVertices(float);
	void generateTextureCoordinats(VERTEX * vertices);
	void fixTextureCoordinats(VERTEX * vertices);
	void verticesToFile(VERTEX * vertices, char * filename);
	void textureCoordinatsToFile(VERTEX * vertices, char * filename);
	

	VERTEX * vertices;

	int NumOfVertices;
	int shownNumberOfVertices;
	int dphi, dtheta;

	Texture * texture1;

	FPGrabber * grabber;

public:
	skydome(void);
	~skydome(){}

	void draw();
	void setGrabber(FPGrabber * g);
};


#endif
